#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include "rngs.h"

// random unit test for the 'adventurer' card.
int main() {
	int p, r, tempDeck, tempDiscard;
	int k[10] = {adventurer, council_room, feast, gardens, mine, 
		remodel, smithy, village, baron, great_hall};
		
	struct gameState G;

	SelectStream(2);
	PutSeed(3);
	
	printf("Testing 'adventurer' card.\n");
	printf("Random Tests.\n");

	int players = Random() * 4;
	int seed = Random() * 10;

	r = initializeGame(players, k, seed, &G);
	p = 2;
	G.deckCount[2] = Random() * 11;
	G.handCount[2] = Random() * 6;

	tempDiscard = G.discardCount[2];
	tempDeck = G.deckCount[2];
	if (cardEffect(adventurer, 1, 0, 0, &G, 0, NULL) != 0)
		printf("Adventurer card failed to compute\n");

	if ((G.discardCount[2] - tempDiscard) != (tempDeck - G.deckCount[2]))
		printf("Discarded more cards than were drawn\n");

	return 0;
}
